//
//  YeeNetClient.m
//  YWBaseFrameWork
//
//  Created by CoderYee on 2017/2/17.
//  Copyright © 2017年 NeiQuan. All rights reserved.
//

#import "YeeNetClient.h"
#import "AFSecurityPolicy.h"

@implementation YeeNetClient
static NSString *_baseUrl = @"";
static AFSSLPinningMode _pinningMode;

+ (instancetype)sharedClient {
    static YeeNetClient *_sharedClient = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedClient = [[YeeNetClient alloc] initWithBaseURL:[NSURL URLWithString:_baseUrl]];
        _sharedClient.securityPolicy = [AFSecurityPolicy policyWithPinningMode:_pinningMode];
    });
    return _sharedClient;
}

+ (void)baseUrl:(NSString *)baseUrl
{
    _baseUrl = baseUrl;
}

+ (void)policyWithPinningMode:(AFSSLPinningMode)pinningMode
{
    _pinningMode = pinningMode;
}

@end
